/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package yqlweb.util;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

/**
 *
 * @author rodrigo
 */
public class Request {

    public InputStream request(String urlString) throws Exception {


       // System.setProperty("http.proxyHost", "192.168.4.45");
       // System.setProperty("http.proxyPort", "8080");

        InputStream retorno;

        // cria o objeto url
        URL url = new URL(urlString);
        // cria o objeto httpurlconnection
        HttpURLConnection connection =
                (HttpURLConnection) url.openConnection();
        // seta o metodo
        connection.setRequestProperty("Request-Method", "POST");
        // seta a variavel para ler o resultado
        connection.setDoInput(true);
        connection.setDoOutput(false);
        connection.connect();
        // abre a conexão pra input

        retorno = connection.getInputStream();

        return retorno;

    }
}
